<div class="cabecalho">
    <h3>Detalhes do Cliente</h3>
    <div class="clear"></div>
</div>

<div class="tabs">
	<ul>
		<li><a href="#tab_info">Informação</a></li>
		<li><a href="#tab_dominio">Dominios</a></li>
		<li><a href="#tab_pag">Pagamentos</a></li>
	</ul>
	<div id="tab_info">
		<label for="nome">Nome:</label>
		<span id="nome"><?php echo $this->cliente->nome; ?><span><br />
		<label>E-mail:</label> 
			<span id="email"><?php echo $this->cliente->email; ?><span><br />
		<label>Telefone:</label> 
			<span id="telefone"><?php echo $this->cliente->telefone; ?><span><br />
		<label>Status:</label> 
			<span id="status"><?php echo ($this->cliente->ativo == 1) ? "Ativo" : "Inativo"; ?><span><br />
	</div>
	
	<div id="tab_dominio">
			
		<?php echo $this->objFormDominio; ?>
		<br />
        <a href="#" id="btnInsertDominio" class="button" title="Salvar" onclick="$('#FormDominio').submit();">Salvar</a>
		
		<hr />	
		
		<table width="100%">
		    <tr>
		        <th>URL</th>
		        <th>Plano</th>
		        <th>Status</th>
		        <th></th>
		    </tr>
		    <?php foreach($this->cliente->findDependentRowset('Dominio') as $dominio) : ?>
		    <tr>
		        <td><?php echo $dominio->url; ?></td>
		        <td><?php echo $dominio->findParentRow('Plano')->nome; ?></td>
		        <td><?php echo ($dominio->ativo == 1)? "Ativo" : "Inativo"; ?></td>
		        <td>
		        	<a href="<?php echo $this->baseUrl();?>/cliente/show/id_cliente/<?php echo $dominio->id_cliente?>/id_dominio/<?php echo $dominio->id_dominio; ?>#tab_dominio">
		        		<img title="Editar" alt="Editar" src="<?php echo $this->baseUrl()?>/assets/images/actions/edit.png" border="0">
		        	</a>
		        	&nbsp;
		        	<a href="<?php echo $this->baseUrl();?>/cliente/show/id_cliente/<?php echo $dominio->id_cliente?>/id_dominio/<?php echo $dominio->id_dominio; ?>#tab_dominio">
		        		<img title="Deletar" alt="deletar" src="<?php echo $this->baseUrl()?>/assets/images/actions/delete.png" border="0">
		        	</a>
		        </td>
		    </tr>
		    <?php endforeach; ?>
		</table>	
	</div>
	
	<div id="tab_pag">
	
		<?php echo $this->formPagamento; ?>
		
		<br />
        <a href="#" id="btnInsertPagamento" class="button" title="Salvar" onclick="$('#FormPagamento').submit();">Salvar</a>
		
		<hr />	
		
		<table width="100%">
		    <tr>
		        <th>Data</th>
		        <th>Referente</th>
		        <th>Dominio</th>
		        <th>Usuario</th>
		    </tr>
		    <?php foreach($this->pagamentos as $pagamento) : ?>
		    <tr>
		        <td><?php echo $pagamento->data; ?></td>
		        <td><?php echo $pagamento->referente; ?></td>
		        <td><?php echo $pagamento->url; ?></td>
		        <td><?php echo $pagamento->findParentRow('Usuario')->nome ?></td>
		    </tr>
		    <?php endforeach; ?>
		</table>	
	</div>
</div>

<script type="text/javascript">
$(document).ready(function(){
	$('.tabs').tabs();
});
</script>